1. Field of the Invention
The present invention relates to a voice codec apparatus mounted in a telephone, an acoustic device or the like, or more in particular to a voice codec apparatus for performing predictive coding. In the present specification, the voice codec apparatus is defined as an apparatus including a coder for coding the voice signal and a decoder for decoding the coded voice signal.
2. Description of the Related Art
The voice codec apparatus is used in a speaker telephone and an audio apparatus or the like. The voice codec apparatus needs to control the gain of the decoded output signal in order to obtain an appropriate amplitude of an output voice signal. Conventionally, the gain control is made on the basis of the amplitude of a voice signal which is input to the voice codec apparatus. Hereinafter, the voice signal which is input to the voice codec apparatus is referred to as "the input voice signal".
As a method for making the gain control, there is a method in which the amplitude of the input voice signal is detected by an amplitude detection circuit and the gain is determined based on a maximum value of the detected amplitude. Such a method is disclosed in Japanese Laid-Open Publication No. 59-44684 entitled "Electronic Clock with Voice Storage Function". According to the description of the reference, the amplitude of the input voice signal is detected at the time of coding, a maximum value of the detected amplitude of the input voice signal is stored and the gain is controlled to an optimum value on the basis of the maximum value of the amplitude stored at the time of decoding.
According to a conventional gain control method described above, when an impulse noise having an amplitude larger than the maximum amplitude value of the input voice signal is superimposed on the input voice signal, the amplitude detection circuit incorrectly detects the amplitude of the impulse noise as the maximum value of the amplitude of the input voice signal. This is because the amplitude detection circuit cannot distinguish the impulse noise and the input voice signal. As a result, at the time of decoding, a gain determining circuit determines the gain on the basis of the maximum value which is different from the maximum amplitude value of the input voice signal. Thus, the conventional gain control method described above has a problem in that the gain determining circuit cannot control the gain accurately when an impulse noise having an amplitude larger than the maximum amplitude value of the input voice signal is superimposed on the input voice signal.
The problem mentioned above will be described below with reference to FIG. 3. FIG. 3 shows a waveform of the input voice signal and a maximum value of the input voice signal detected by the conventional amplitude detection circuit in the case where the impulse noise is superimposed on the input voice signal. As shown in FIG. 3, in the case where the impulse noise N is superimposed on the input voice signal S, the amplitude detection circuit for detecting the amplitude of the input voice signal detects the maximum value of amplitude of the impulse noise N as a maximum amplitude value Smax of the input voice signal S. The detected maximum value Smax is stored in memory. At the time of reproduction, a gain determining circuit reads the maximum value Smax stored in the memory, and the gain of the output signal is determined on the basis of the maximum value Smax. As a consequence, the gain thus determined is smaller than the gain in the absence of the impulse noise, which raises a problem in that the volume of the voice signal reproduced is smaller than that in the absence of the impulse noise.